home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpC_108_ModelessDialog < prev    next >
Encoding:
Text File  |  1992-04-08  |  2.0 KB  |  104 lines

  1. /* %filename% -- modeless dialog */
  2. /* Created %date% %time% by AppMaker */
  3.  
  4. #include <Types.h>
  5. #include <Quickdraw.h>
  6. #include <Controls.h>
  7. #include <Dialogs.h>
  8. #include <Events.h>
  9. #include <Lists.h>
  10. #include <Menus.h>
  11. #include <TextEdit.h>
  12. #include "ResourceDefs.h"
  13. #include "Miscellany.h"
  14. #include "DialogAids.h"
  15. #include "WindowAids.h"
  16. #include "%dlogname%.h"
  17.  
  18. DialogPtr        %dlogname%Dialog;
  19.  
  20. %for each item gen itemNr%
  21.  
  22. %If lang = MPW%
  23.     #pragma segment %dlogname% 
  24.  
  25. %endif%
  26. %for each item gen auxiliaryProto%
  27.  
  28. %push needsRefCon%
  29. %for each item gen auxiliary%
  30. /*----------*/
  31. void Init%dlogname% ()
  32. {
  33.     DialogPtr        theDialog;
  34.     Ptr                %dlogname%Data;
  35.     register %dlogname%RecPtr    info;
  36.  
  37.     %dlogname%Dialog = GetNewDialog (%dlogname%ID, nil, (WindowPtr) -1L);
  38.     theDialog = %dlogname%Dialog;
  39.     SetPort (theDialog);
  40.     %dlogname%Data = NewPtr (sizeof (%dlogname%Rec));
  41.     SetWRefCon (theDialog, (long) %dlogname%Data);
  42.     info = (%dlogname%RecPtr) %dlogname%Data;
  43.     %for each item gen init field%
  44.  
  45.     %for each item gen set%
  46.  
  47.     %for each item gen enable%
  48.  
  49. } /*Init%dlogname%*/
  50.  
  51. /*----------*/
  52. void Do%dlogname% ()
  53. {
  54.     if (%dlogname%Dialog != nil) {
  55.         SelectWindow (%dlogname%Dialog);
  56.         ShowWindow (%dlogname%Dialog);
  57.     }
  58. } /*Do%dlogname%*/
  59.  
  60. /*----------*/
  61. void Close%dlogname% ()
  62. {
  63.     HideWindow (%dlogname%Dialog);
  64. } /*Close%dlogname%*/
  65.  
  66. /*----------*/
  67. Boolean Filter%dlogname%%    %(DialogPtr            whichDialog, 
  68.                              EventRecord        *event, 
  69.                              short                *itemHit)
  70. {
  71.     Boolean                filtered;
  72.     %dlogname%RecPtr%    %data;
  73.  
  74. #pragma unused (data) 
  75.  
  76.     filtered = false;
  77.     %for each item gen filter%
  78.  
  79.     if (!filtered) {
  80.         filtered = StandardFilter (whichDialog, event, itemHit);
  81.     }
  82.     return (filtered);
  83. } /*Filter%dlogname%*/
  84.  
  85. /*----------*/
  86. void Do%dlogname%Item    (short        itemNr)
  87. {
  88.     DialogPtr        theDialog;
  89.     register %dlogname%RecPtr    info;
  90.  
  91.     theDialog = %dlogname%Dialog;
  92.     SetPort (theDialog);
  93.     info = (%dlogname%RecPtr) GetWRefCon (theDialog);
  94.     switch (itemNr) {
  95.         %for each item gen hit%
  96.     
  97.     } /*switch*/
  98.     %for each item gen enable%
  99.  
  100. } /*Do%dlogname%Item*/
  101.  
  102. /* %dlogname% */
  103. %pop needsRefCon%
  104.